package com.fl.test.mapper;
import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import com.fl.Application;
import com.fl.mapper.TStudentMapper;
import com.fl.mapper.TTeacherMapper;
import com.fl.model.TStudent;
import com.fl.model.TTeacher;


@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Application.class)
@WebAppConfiguration
public class TeacherInsert {
	
	@Autowired TTeacherMapper TTeacherMapper;

	@Test
	public void testInsert100()
	{
		TTeacher instance=new TTeacher();
		instance.setFid("aok47");
		instance.setFage(20);
		instance.setFname("aok47");
		instance.setFremark("");
		TTeacherMapper.insert(instance);
	}

	@Test
	public void update()
	{
		TTeacher instance=this.TTeacherMapper.selectByPrimaryKey("aok47");
		instance.setFage(25);
		this.TTeacherMapper.updateByPrimaryKeySelective(instance);
		
		
	/*	TStudent model=new TStudent();
		model.setFid("ak004");
		model.setFage(20);
		model.setFremark("spirngvue");
		TStudentMapper.updateByPrimaryKeySelective(model);*/
		
	}
	
	
	@Test
	public void delete(){
		
		
		this.TTeacherMapper.deleteByPrimaryKey("aok47");
		
	}
	
	@Test
	public void Search(){
		
		
		
		this.TTeacherMapper.selectAll();
		
	}
	
	
	
	
}
